#-*- encoding: utf-8 -*-
#---------------------------------------------------------------------------------
# SConscript
#---------------------------------------------------------------------------------
import os
from building import *
Import('RTT_ROOT')
Import('rtconfig')

#---------------------------------------------------------------------------------
# Package configuration
#---------------------------------------------------------------------------------
PKGNAME = 'startup'
DEPENDS = []

#---------------------------------------------------------------------------------
# Compile the configuration
#---------------------------------------------------------------------------------
SOURCES          = Glob('*.c')
CPPPATH          = [os.path.join(GetCurrentDir(), '.')]

ASFLAGS = ' -I' + GetCurrentDir()

#---------------------------------------------------------------------------------
# Feature clip configuration, optional
#---------------------------------------------------------------------------------

#---------------------------------------------------------------------------------
# Compiler platform configuration, optional
#---------------------------------------------------------------------------------

#---------------------------------------------------------------------------------
# System variables
#---------------------------------------------------------------------------------
objs   = []
root   = GetCurrentDir()

#---------------------------------------------------------------------------------
# Sub target
#---------------------------------------------------------------------------------
list = os.listdir(root)
if GetDepend(DEPENDS):
    for d in list:
        path = os.path.join(root, d)
        if os.path.isfile(os.path.join(path, 'SConscript')):
            objs = objs + SConscript(os.path.join(d, 'SConscript'))

#---------------------------------------------------------------------------------
# Main target
#---------------------------------------------------------------------------------
objs += DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS, CPPPATH = CPPPATH, ASFLAGS = ASFLAGS)

Return("objs")
#---------------------------------------------------------------------------------
# End
#---------------------------------------------------------------------------------
